<?php
namespace app\api\validate\User;
use bang\validate\Validate;

/**
 * Customer验证模型
 * Class CustomerValidate
 * @package app\admin\validate\User
 */
class UserValidate extends Validate
{
    protected $rule =   [
        'username'  => 'require|max:50',
        'password'  => 'require|max:32',
        'mobile'  => 'require|mobile',
        'code' => 'require|max:6',
        'status'   => 'require|in:0,1',
    ];

    protected $message  =   [
        'username.require' => '缺少用户名',
        'password.require' => '缺少登录密码',
        'mobile.require' => '缺少手机号',
        'code.require' => '缺少验证码',
    ];

    protected $field = [
        'username' => '用户名',
        'password' => '登录密码',
        'mobile' => '手机号',
        'code' => '验证码',
    ];

    protected $scene = [
        'userLogin'  =>  ['username' , 'password'],
        'mobileLogin'  =>  ['mobile' , 'code'],
    ];
}